Skip to content

0.11.4: the doctest adapter reports what doctest knows; the protocol's variables stay out of what a case starts - #32

Open
ZheFeng7110 wants to merge 2 commits into
mcpp-community:mainfrom
ZheFeng7110:doctest-protocol
Open

ZheFeng7110 wants to merge 2 commits into
mcpp-community:mainfrom
ZheFeng7110:doctest-protocol

Conversation

@ZheFeng7110

Copy link
Copy Markdown
Member

The doctest adapter reports what doctest knows, and the adapters keep the protocol's variables from what a case starts. Closes #29.

  • Distinct identifiers (P3.2). Of two cases with one name, in doctest's order (file, then line), the later is <suite>/<name>#2; name stays doctest's, and --split case gives each its process.
  • Expected failures (P3.3, P5.3). should_fail and expected_failures(n) are listed expect: "fail"; a case ends xfail when it fails as expected (expected_failures: exactly n times), xpass when nothing fails, fail when it fails another number of times. may_fail states no expectation and stays pass.
  • Timeout (O5). doctest::timeout(s) is listed as the case's timeout (doctest already folds a suite's into it).
  • The place of an exception or a crash is the case's own TEST_CASE line, not :0.
  • P2.2. The doctest and GoogleTest adapters read the handshake once, then remove its variables from the C library's environment before any case runs. mcpplibs.os states no change to a program's own environment (openkal's set does not change while a program runs), so the adapters call the host's C library (unsetenv, _putenv_s); env: a way for a program to keep variables from the programs it starts (mtest protocol P2.2) mcpplibs/os#29 asks its maintainers how the library should express this. The library mcpplibs.mtest still strips the variables only from what e2e::run starts.
  • The conformance suite holds an implementation below level 3 that expresses expected to fail to its xfail; the doctest fixture expresses it.
  • The doctest adapter has a test of its own (adapters/doctest/tests/handshake.cpp): a case and a program it starts see no protocol variable; CI runs it. It fails with the removal taken out.
  • The guides state the rules, that doctest's queries under a runner report to the report, and that a file whose main comes from a header declares it.
  • 0.11.4.

Checked locally (mcpp 2026.11.20.1, gcc 16.1.0, Linux x86_64): mcpp test -p for mcpplibs.mtest, mcpplibs.mtest.manifest, mtest.mtest, conformance, mcpplibs.mtest.doctest; the conformance suite against every fixture; the probe of #29, whose five observations no longer hold. The Windows branch of the variables' removal is not built by CI (the adapters are not in the image matrix).

… an exception (mcpp-community#29)

Of two cases with one name the later is <suite>/<name>mcpp-community#2. should_fail and expected_failures(n) are listed expect: fail and end xfail or xpass; may_fail stays pass. doctest::timeout is listed as the case's timeout. An exception or a crash fails at the case's place. The conformance suite holds an implementation below level 3 that expresses an expected failure to its xfail. 0.11.4.
…ts (P2.2, mcpp-community#29)

The adapters read the handshake once, then remove its variables from the C library's environment before any case runs, so a test program a case starts does not append to its parent's report. mcpplibs.os states no change to a program's own environment (mcpplibs/os#29), so the adapters call the host's C library. The doctest adapter's own test checks a case and a program it starts under mcpp test; CI runs it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant